home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / mail / readers / mailx-5.003 / mailx-5.5-kw.diff
Text File  |  1995-05-30  |  15KB  |  545 lines

  1. Only in mailx-5.5: Makefile.orig
  2. diff -cr mailx-5.5/README mailx-5.5-kw/README
  3. *** mailx-5.5/README    Tue May 30 01:12:03 1995
  4. --- mailx-5.5-kw/README    Tue May 30 01:35:21 1995
  5. ***************
  6. *** 1,23 ****
  7.   
  8. - These sources are from Mailx "5.5 6/1/90" in the NetBSD-current
  9. - release.  NetBSD-current is also the release that all of the Debian
  10. - network utilities are taken from, and is widely regarded as the best
  11. - of the millions of BSD distributions out there.  (By "widely
  12. - regarded", I mean that it's my favorite.  :-)
  13. - If you had the mailx package from Debian 0.91 (or previous version)
  14. - installed, you should de-install it before installing this version.
  15. - Why?  Because NetBSD has renamed the files "Mail.help",
  16. - "Mail.tildehelp", and "Mail.rc" to use small "m"s.  To be consistent,
  17. - this package also looks for small "m"s.  Therefore, you'll want to
  18. - erase the files with the capital "M"s.
  19. - There is an old version of mailx which has been modified to retrieve
  20. - mail using POP.  These sources are in /afs/gza.com/misc/popmail.  I am
  21. - integrating the POP support code into these sources.  However, I don't
  22. - want to distribute the POP patch until the current (small) patch has
  23. - been more tested.
  24.   
  25. ! Have a nice day.
  26. ! -Sal Valente. <svalente@athena.mit.edu>
  27.   
  28. --- 1,68 ----
  29. + mailx-5.5-kw 5/30/95
  30.   
  31.   
  32. ! WHAT'S IN THIS PATCH
  33.   
  34. + There are a bunch of little features, common in System V and SunOS
  35. + versions of mailx, that are missing from the NetBSD-based version
  36. + distributed with Linux.  This patch attempts to fill in some of what's
  37. + missing.
  38. + Changes from debian mailx-5.5 include:
  39. + 5/4/95:
  40. + -- interpret prompt variable
  41. + -- interpret ~a and ~A tilde escapes
  42. + -- updated tildehelp list
  43. + -- changed mail.rc to ignore nothing (just my personal preference)
  44. + -- accept From lines with times of the form hh:mm (formerly took only hh:mm:ss)
  45. + 5/7/95:
  46. + -- Save (S) command saves to mailbox named after author
  47. + -- take startup commands from file named by environment variable MAILRC
  48. + 5/30/95:
  49. + -- -H switch for header summary only
  50. + Still to be done:
  51. + -- pipe ~p output through PAGER (see type1 in cmd1.c for an example)
  52. + -- save (s) by default to MBOX (instead of "No file specified.")
  53. + -- ~q should save to dead.letter, ~x is not known
  54. + -- update man page
  55. + -- allnet and showto ("showto" shows recipient instead of sender if sender
  56. +    is current user)
  57. + Possibly difficult:
  58. + -- interpret editheaders variable as in SunOS version
  59. + Bugs:
  60. + -- ~a,~A tilde escapes leave an extra trailing blank on each line
  61. + -- to conform to original style, I should really be using char *cp
  62. +    instead of new variables sig and prompt to be looking up variables
  63. + -- -H switch implementation is kind of gross.  grep for "hdronly" in
  64. +    source files; much room for improvement!
  65. + HOW TO INSTALL
  66. + Apply Sal Valente's debian patch first, so:
  67. +    tar xvfz mailx-5.5.tar.gz
  68. +    cd mailx-5.5
  69. +    zcat ../mailx-5.5.debian.diff.gz | patch -p1
  70. +    zcat ../mailx-5.5-kw.diff.gz | patch -p1
  71. +    make
  72. + Or you may wish to just uncompress the diff file and pick and choose
  73. + the changes that you like.
  74. + AUTHOR
  75. + Ken Whang  <Kenneth.C.Whang-1@umn.edu>
  76. Only in mailx-5.5-kw: README.debian
  77. Only in mailx-5.5: README.orig
  78. Only in mailx-5.5-kw: TO-DO
  79. diff -cr mailx-5.5/cmd1.c mailx-5.5-kw/cmd1.c
  80. *** mailx-5.5/cmd1.c    Fri Dec 17 01:13:00 1993
  81. --- mailx-5.5-kw/cmd1.c    Tue May 30 00:41:35 1995
  82. ***************
  83. *** 44,49 ****
  84. --- 44,51 ----
  85.    * User commands.
  86.    */
  87.   
  88. + extern char hdronly;
  89.   /*
  90.    * Print the current active headings.
  91.    * Don't change dot if invoker didn't give an argument.
  92. ***************
  93. *** 177,183 ****
  94.       /*
  95.        * Bletch!
  96.        */
  97. !     curind = dot == mp ? '>' : ' ';
  98.       dispc = ' ';
  99.       if (mp->m_flag & MSAVED)
  100.           dispc = '*';
  101. --- 179,185 ----
  102.       /*
  103.        * Bletch!
  104.        */
  105. !     curind = (dot == mp) && !hdronly ? '>' : ' ';
  106.       dispc = ' ';
  107.       if (mp->m_flag & MSAVED)
  108.           dispc = '*';
  109. ***************
  110. *** 194,199 ****
  111. --- 196,205 ----
  112.       subjlen = screenwidth - 50 - strlen(wcount);
  113.       name = value("show-rcpt") != NOSTR ?
  114.           skin(hfield("to", mp)) : nameof(mp, 0);
  115. +     /*
  116. +     name = (value("show-rcpt") != NOSTR)||(value("showto") != NOSTR) ?
  117. +         skin(hfield("to", mp)) : nameof(mp, 0);
  118. +     */
  119.       if (subjline == NOSTR || subjlen < 0)        /* pretty pathetic */
  120.           printf("%c%c%3d %-20.20s  %16.16s %s\n",
  121.               curind, dispc, mesg, name, hl.l_date, wcount);
  122. diff -cr mailx-5.5/cmd2.c mailx-5.5-kw/cmd2.c
  123. *** mailx-5.5/cmd2.c    Fri Dec 17 01:13:00 1993
  124. --- mailx-5.5-kw/cmd2.c    Sat May  6 23:49:48 1995
  125. ***************
  126. *** 137,142 ****
  127. --- 137,168 ----
  128.   }
  129.   
  130.   /*
  131. +  * Save a message in a file named after author (or, if "showto" is set and
  132. +  * from current user, the recipient -- not implemented).  Mark the message
  133. +  * as saved so we can discard when the user quits.
  134. +  */
  135. + Save(msgvec)
  136. +     int *msgvec;
  137. + {
  138. +     struct message *mp;
  139. +     char *cp, *name;
  140. +     mp = &message[msgvec[0]-1];
  141. +     /*
  142. +     name = value("show-rcpt") != NOSTR ?
  143. +         skin(hfield("to", mp)) : nameof(mp, 0);
  144. +     name = (value("show-rcpt") != NOSTR)||(value("showto") != NOSTR) ?
  145. +         skin(hfield("to", mp)) : nameof(mp, 0);
  146. +     */
  147. +     name = nameof(mp, 0);
  148. +     if ((cp = strchr(name, '@')) != NULL)
  149. +       *cp = '\0';            /* remove trailing @host.domain */
  150. +     return save1(name, 1, "save", saveignore);
  151. + }
  152. + /*
  153.    * Copy a message to a file without affected its saved-ness
  154.    */
  155.   copycmd(str)
  156. diff -cr mailx-5.5/cmdtab.c mailx-5.5-kw/cmdtab.c
  157. *** mailx-5.5/cmdtab.c    Fri Dec 17 01:13:00 1993
  158. --- mailx-5.5-kw/cmdtab.c    Sat May  6 22:03:25 1995
  159. ***************
  160. *** 45,51 ****
  161.    */
  162.   
  163.   extern int type(), preserve(), delete(), undelete(), next(), shell(), schdir();
  164. ! extern int save(), help(), headers(), pdot(), respond(), editor();
  165.   extern int quitcmd(), rexit(), pcmdlist(), sendmail(), from(), copycmd();
  166.   extern int messize(), psalloc(), deltype(), unset(), set(), source();
  167.   extern int pversion(), group(), top(), core(), null(), stouch(), visual();
  168. --- 45,51 ----
  169.    */
  170.   
  171.   extern int type(), preserve(), delete(), undelete(), next(), shell(), schdir();
  172. ! extern int save(), Save(), help(), headers(), pdot(), respond(), editor();
  173.   extern int quitcmd(), rexit(), pcmdlist(), sendmail(), from(), copycmd();
  174.   extern int messize(), psalloc(), deltype(), unset(), set(), source();
  175.   extern int pversion(), group(), top(), core(), null(), stouch(), visual();
  176. ***************
  177. *** 83,88 ****
  178. --- 83,89 ----
  179.       "chdir",    schdir,        M|RAWLIST,    0,    1,
  180.       "cd",        schdir,        M|RAWLIST,    0,    1,
  181.       "save",        save,        STRLIST,    0,    0,
  182. +     "Save",        Save,        MSGLIST,    0,    0,
  183.       "source",    source,        M|RAWLIST,    1,    1,
  184.       "set",        set,        M|RAWLIST,    0,    1000,
  185.       "shell",    dosh,        I|NOLIST,    0,    0,
  186. diff -cr mailx-5.5/collect.c mailx-5.5-kw/collect.c
  187. *** mailx-5.5/collect.c    Tue May 30 01:12:03 1995
  188. --- mailx-5.5-kw/collect.c    Sat May  6 23:36:52 1995
  189. ***************
  190. *** 84,89 ****
  191. --- 84,91 ----
  192.       int omask;
  193.       void collint(), collhup(), collstop();
  194.   
  195. +     char *defaultsig = "";
  196.       collf = NULL;
  197.       /*
  198.        * Start catching signals from here, but we're still die on interrupts
  199. ***************
  200. *** 361,366 ****
  201. --- 363,380 ----
  202.                */
  203.               rewind(collf);
  204.               mesedit(collf, c);
  205. +             goto cont;
  206. +         case 'A':
  207. +         case 'a':
  208. +             /*
  209. +              * Insert signature ("autograph").
  210. +              * 'A' means to use Sign
  211. +              * 'a' means to use sign
  212. +              */
  213. +             if ((cp = value(c == 'A' ? "Sign" : "sign")) == NOSTR)
  214. +               cp = defaultsig;
  215. +             printf("%s\n", cp);
  216. +             putline(collf, cp);
  217.               goto cont;
  218.           }
  219.       }
  220. Only in mailx-5.5: collect.c.orig
  221. Only in mailx-5.5: def.h.orig
  222. diff -cr mailx-5.5/head.c mailx-5.5-kw/head.c
  223. *** mailx-5.5/head.c    Fri Dec 17 01:13:00 1993
  224. --- mailx-5.5-kw/head.c    Thu May  4 18:14:21 1995
  225. ***************
  226. *** 160,172 ****
  227.    * 'N'    A new line
  228.    */
  229.   char ctype[] = "Aaa Aaa O0 00:00:00 0000";
  230.   char tmztype[] = "Aaa Aaa O0 00:00:00 AAA 0000";
  231.   
  232.   isdate(date)
  233.       char date[];
  234.   {
  235.   
  236. !     return cmatch(date, ctype) || cmatch(date, tmztype);
  237.   }
  238.   
  239.   /*
  240. --- 160,175 ----
  241.    * 'N'    A new line
  242.    */
  243.   char ctype[] = "Aaa Aaa O0 00:00:00 0000";
  244. + char ctype2[] = "Aaa Aaa O0 00:00 0000";
  245.   char tmztype[] = "Aaa Aaa O0 00:00:00 AAA 0000";
  246. + char tmztype2[] = "Aaa Aaa O0 00:00 AAA 0000";
  247.   
  248.   isdate(date)
  249.       char date[];
  250.   {
  251.   
  252. !     return cmatch(date, ctype) || cmatch(date, tmztype)
  253. !       || cmatch(date, ctype2) || cmatch(date, tmztype2);
  254.   }
  255.   
  256.   /*
  257. diff -cr mailx-5.5/lex.c mailx-5.5-kw/lex.c
  258. *** mailx-5.5/lex.c    Fri Dec 17 01:13:00 1993
  259. --- mailx-5.5-kw/lex.c    Mon May 29 19:44:57 1995
  260. ***************
  261. *** 46,52 ****
  262.    * Lexical processing of commands.
  263.    */
  264.   
  265. ! char    *prompt = "& ";
  266.   
  267.   /*
  268.    * Set up editing on the given file name.
  269. --- 46,53 ----
  270.    * Lexical processing of commands.
  271.    */
  272.   
  273. ! char    *defaultprompt = "& ", *prompt;
  274. ! extern char hdronly;
  275.   
  276.   /*
  277.    * Set up editing on the given file name.
  278. ***************
  279. *** 146,152 ****
  280.       sawcom = 0;
  281.       if (!edit && msgCount == 0) {
  282.   nomail:
  283. !         fprintf(stderr, "No mail for %s\n", who);
  284.           return -1;
  285.       }
  286.       return(0);
  287. --- 147,153 ----
  288.       sawcom = 0;
  289.       if (!edit && msgCount == 0) {
  290.   nomail:
  291. !         if (!hdronly) fprintf(stderr, "No mail for %s\n", who);
  292.           return -1;
  293.       }
  294.       return(0);
  295. ***************
  296. *** 183,188 ****
  297. --- 184,191 ----
  298.            */
  299.           if (!sourcing && value("interactive") != NOSTR) {
  300.               reset_on_stop = 1;
  301. +             if ((prompt = value("prompt")) == NOSTR)
  302. +                 prompt = defaultprompt;
  303.               printf(prompt);
  304.           }
  305.           fflush(stdout);
  306. ***************
  307. *** 597,618 ****
  308.               ename = zname;
  309.           }
  310.       }
  311. !     printf("\"%s\": ", ename);
  312. !     if (msgCount == 1)
  313. !         printf("1 message");
  314. !     else
  315. !         printf("%d messages", msgCount);
  316. !     if (n > 0)
  317. !         printf(" %d new", n);
  318. !     if (u-n > 0)
  319. !         printf(" %d unread", u);
  320. !     if (d > 0)
  321. !         printf(" %d deleted", d);
  322. !     if (s > 0)
  323. !         printf(" %d saved", s);
  324. !     if (readonly)
  325. !         printf(" [Read only]");
  326. !     printf("\n");
  327.       return(mdot);
  328.   }
  329.   
  330. --- 600,623 ----
  331.               ename = zname;
  332.           }
  333.       }
  334. !     if (!hdronly) {
  335. !         printf("\"%s\": ", ename);
  336. !         if (msgCount == 1)
  337. !             printf("1 message");
  338. !         else
  339. !             printf("%d messages", msgCount);
  340. !         if (n > 0)
  341. !             printf(" %d new", n);
  342. !         if (u-n > 0)
  343. !             printf(" %d unread", u);
  344. !         if (d > 0)
  345. !             printf(" %d deleted", d);
  346. !         if (s > 0)
  347. !             printf(" %d saved", s);
  348. !         if (readonly)
  349. !             printf(" [Read only]");
  350. !         printf("\n");
  351. !     }
  352.       return(mdot);
  353.   }
  354.   
  355. Only in mailx-5.5: mail.1.orig
  356. diff -cr mailx-5.5/main.c mailx-5.5-kw/main.c
  357. *** mailx-5.5/main.c    Sun Mar 20 14:39:10 1994
  358. --- mailx-5.5-kw/main.c    Mon May 29 19:39:29 1995
  359. ***************
  360. *** 51,56 ****
  361. --- 51,57 ----
  362.    * Startup -- interface with user.
  363.    */
  364.   
  365. + char hdronly = 0;
  366.   jmp_buf    hdrjmp;
  367.   
  368.   main(argc, argv)
  369. ***************
  370. *** 60,65 ****
  371. --- 61,67 ----
  372.       struct name *to, *cc, *bcc, *smopts;
  373.       char *subject;
  374.       char *ef;
  375. +     char *mailrc;
  376.       char nosrc = 0;
  377.       void hdrstop();
  378.       sig_t prevint;
  379. ***************
  380. *** 89,95 ****
  381.       bcc = NIL;
  382.       smopts = NIL;
  383.       subject = NOSTR;
  384. !     while ((i = getopt(argc, argv, "INT:b:c:dfins:u:v")) != EOF) {
  385.           switch (i) {
  386.           case 'T':
  387.               /*
  388. --- 91,97 ----
  389.       bcc = NIL;
  390.       smopts = NIL;
  391.       subject = NOSTR;
  392. !     while ((i = getopt(argc, argv, "INHT:b:c:dfins:u:v")) != EOF) {
  393.           switch (i) {
  394.           case 'T':
  395.               /*
  396. ***************
  397. *** 153,158 ****
  398. --- 155,166 ----
  399.                */
  400.               assign("noheader", "");
  401.               break;
  402. +         case 'H':
  403. +             /*
  404. +              * Print initial headers and exit.
  405. +              */
  406. +             assign("quiet", "");
  407. +             hdronly++;
  408.           case 'v':
  409.               /*
  410.                * Send mailer verbose flag
  411. ***************
  412. *** 179,188 ****
  413.               break;
  414.           case '?':
  415.               fputs("\
  416. ! Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...\n\
  417.               [- sendmail-options ...]\n\
  418. !        mail [-iInNv] -f [name]\n\
  419. !        mail [-iInNv] [-u user]\n",
  420.                   stderr);
  421.               exit(1);
  422.           }
  423. --- 187,196 ----
  424.               break;
  425.           case '?':
  426.               fputs("\
  427. ! Usage: mail [-iIHnv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...\n\
  428.               [- sendmail-options ...]\n\
  429. !        mail [-iIHnNv] -f [name]\n\
  430. !        mail [-iIHnNv] [-u user]\n",
  431.                   stderr);
  432.               exit(1);
  433.           }
  434. ***************
  435. *** 213,219 ****
  436.        * Expand returns a savestr, but load only uses the file name
  437.        * for fopen, so it's safe to do this.
  438.        */
  439. !     load(expand("~/.mailrc"));
  440.       if (!rcvmode) {
  441.           mail(to, cc, bcc, smopts, subject);
  442.           /*
  443. --- 221,227 ----
  444.        * Expand returns a savestr, but load only uses the file name
  445.        * for fopen, so it's safe to do this.
  446.        */
  447. !     load(expand( (mailrc=value("MAILRC"))==NOSTR ?  "~/.mailrc" : mailrc));
  448.       if (!rcvmode) {
  449.           mail(to, cc, bcc, smopts, subject);
  450.           /*
  451. ***************
  452. *** 242,252 ****
  453.           fflush(stdout);
  454.           signal(SIGINT, prevint);
  455.       }
  456. !     commands();
  457.       signal(SIGHUP, SIG_IGN);
  458.       signal(SIGINT, SIG_IGN);
  459.       signal(SIGQUIT, SIG_IGN);
  460. !     quit();
  461.       exit(0);
  462.   }
  463.   
  464. --- 250,260 ----
  465.           fflush(stdout);
  466.           signal(SIGINT, prevint);
  467.       }
  468. !     if (!hdronly) commands();
  469.       signal(SIGHUP, SIG_IGN);
  470.       signal(SIGINT, SIG_IGN);
  471.       signal(SIGQUIT, SIG_IGN);
  472. !     if (!hdronly) quit();
  473.       exit(0);
  474.   }
  475.   
  476. diff -cr mailx-5.5/misc/mail.rc mailx-5.5-kw/misc/mail.rc
  477. *** mailx-5.5/misc/mail.rc    Fri Dec 17 01:13:00 1993
  478. --- mailx-5.5-kw/misc/mail.rc    Thu May  4 20:24:40 1995
  479. ***************
  480. *** 1,2 ****
  481.   set append dot save asksub
  482. ! ignore Received Message-Id Resent-Message-Id Status Mail-From Return-Path Via
  483. --- 1,2 ----
  484.   set append dot save asksub
  485. ! # ignore Received Message-Id Resent-Message-Id Status Mail-From Return-Path Via
  486. diff -cr mailx-5.5/misc/mail.tildehelp mailx-5.5-kw/misc/mail.tildehelp
  487. *** mailx-5.5/misc/mail.tildehelp    Fri Dec 17 01:14:00 1993
  488. --- mailx-5.5-kw/misc/mail.tildehelp    Thu May  4 20:23:39 1995
  489. ***************
  490. *** 1,6 ****
  491. --- 1,7 ----
  492.   -----------------------------------------------------------
  493.   The following ~ escapes are defined:
  494.   ~~        Quote a single tilde
  495. + ~a,~A           Autograph (insert 'sign','Sign' variable)
  496.   ~b users    Add users to "blind" cc list
  497.   ~c users    Add users to cc list
  498.   ~d        Read in dead.letter
  499. Only in mailx-5.5: pathnames.h.orig
  500. Only in mailx-5.5: rcv.h.orig
  501. diff -cr mailx-5.5/version.c mailx-5.5-kw/version.c
  502. *** mailx-5.5/version.c    Fri Dec 17 01:13:00 1993
  503. --- mailx-5.5-kw/version.c    Tue May 30 00:43:56 1995
  504. ***************
  505. *** 40,43 ****
  506.    * Just keep track of the date/sid of this version of Mail.
  507.    * Load this file first to get a "total" Mail version.
  508.    */
  509. ! char    *version = "5.5 6/1/90";
  510. --- 40,44 ----
  511.    * Just keep track of the date/sid of this version of Mail.
  512.    * Load this file first to get a "total" Mail version.
  513.    */
  514. ! /*char    *version = "5.5 6/1/90"*/;
  515. ! char    *version = "5.5-kw 5/30/95";
  516.